<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./MasterPageAdmin.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html">

    <ui:define name="title">
        <title>Admin Page</title>
    </ui:define>
    <ui:define name="content">
                        <h1><h:outputText value="List User"/></h1>
                        <h2>
                            <h:selectOneMenu id="optionsearch" value="#{beanUser.optionsearch}">
                                <f:selectItem itemValue="Account" itemLabel="Account"/>
                                <f:selectItem itemValue="FullName" itemLabel="Full Name"/>
                            </h:selectOneMenu>
                            <h:inputText value="#{beanUser.valieSearch}"/>
                            <h:commandButton value="Search" action="#{beanUser.searchUser}"/>
                            <h:commandButton value="Reset" action="#{beanUser.resetUser}"/>
                        </h2>
                        <h:dataTable id="show" value="#{beanUser.listUser}" var="user" border="5">
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Account"/>
                                </f:facet>
                                <h:outputText value="#{user.account}"  rendered="#{not user.editUser}"/>
                            </h:column>

                             <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Email"/>
                                </f:facet>
                                <h:outputText value="#{user.email}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Type"/>
                                </f:facet>
                                <h:outputText value="#{user.type}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="FullName"/>
                                </f:facet>
                                <h:outputText value="#{user.fullname}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="BirthDay"/>
                                </f:facet>
                                <h:outputText value="#{user.birthdate}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Sex"/>
                                </f:facet>
                                <h:outputText value="#{user.sex}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Age"/>
                                </f:facet>
                                <h:outputText value="#{user.age}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="City"/>
                                </f:facet>
                                <h:outputText value="#{user.city}"/>
                            </h:column>
                           
                           
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Status"/>
                                </f:facet>
                                <h:commandLink value="#{user.status}" action="#{beanUser.active(user)}"/>
                            </h:column>
                            
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Detail"/>
                                </f:facet>
                                <h:commandLink value="Detail" action="#{beanUser.showDetail(user)}"/>
                            </h:column>
                            
                        </h:dataTable>

</ui:define>
                   
</ui:composition>